<?php
use yii\widgets\ActiveForm;
?>
<link rel="stylesheet" href="../static/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../static/jBox/Skins/Metro/jbox.css" type="text/css">
<link rel="stylesheet" href="../static/dist/css/AdminLTE.min.css" type="text/css">
<link rel="stylesheet" href="../static/css/admin.css" type="text/css">
<link rel="stylesheet" href="../static/plugins/treeTable/jquery.treetable.css" type="text/css">
<link rel="stylesheet" href="../static/plugins/treeTable/jquery.treetable.theme.default.css" type="text/css">
<link rel="stylesheet" href="../static/plugins/datatables/jquery.dataTables.css" type="text/css">
<link rel="stylesheet" type="text/css" href="../static/app/goods-keyword/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../static/app/goods-keyword/css/jquery.dropdown.css">
<style>
.ul_tree_display {
	display: none;
}

.tr_tree_display {
	display: none;
}

.table>tbody>tr>td {
	vertical-align: middle;
	font-size: 0.8em;
}

.layui-layer-content p {
	padding: 15px;
}

.dataTables_length {
	margin-top: 10px;
}
#table_list tr {
	height:45px;
}
</style>
<div class="tabs-panel">
	<div class="row">
		<div class="col-xs-12">
			<div class="box">
				<div class="box-header">
					<!-- add by lizenan 20180211 【后台需求】商城导览/商城导览增加搜索：品牌名称搜索 513 start -->
					品牌名称:	<input class="depart-input" name="brand_name" id="brand_name_search" type="text" placeholder="">
					<button type="button" class="btn btn-primary depart-modal" onclick="table_list_reload()" style="width: 100px;">查询</button>
					&nbsp;
					<button type="button" class="btn btn-warning depart-modal" id="reset_button" style="width: 100px;">重置</button>
					<!-- add by lizenan 20180211 【后台需求】商城导览/商城导览增加搜索：品牌名称搜索 513 end -->
				</div>
				<div class="box-body">
					<button type="button" class="btn btn-success depart-modal add-brand" style="width: 100px;">添加品牌</button>
					<table id="table_list" class="table table-bordered table-hover">
						<thead>
							<tr>
								<th class="">操作</th>
								<th class="">ID</th>
								<th class="">品牌名称</th>
								<th class="">排序</th>
								<th class="">楼层</th>
								<th class="">分类</th>
								<th class=""><?=TITLE_STATUS?></th>
							</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
</div>
<div class="modal fade" id="brand-modal" style="background: rgba(236, 230, 230, 0.3);" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="width: 60%;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">品牌操作</h4>
            </div>
            <div class="modal-body">
                <form action="/shopping-mall/save-brand" method="post" name="brand_form" id="brand_form">
                    <div class="box-body">
                        <div class="form-group col-sm-12">
                        	<div class="col-sm-12">
                                <label for="tag_group_id_add"><span class="text-danger" style="font-size:20px;">* </span>品牌名称</label>
                                <input style="width: 50%;" class="form-control" name="brand_name" id="brand_name" placeholder="品牌名称" type="text">
                            </div>
                        </div>
                        <div class="form-group col-sm-12">
                        	<div class="col-sm-12">
                                <label for="tag_group_id_add">排序</label>
                                <input style="width: 50%;" class="form-control" name="sort" id="sort" placeholder="排序" type="text">
                            </div>
                        </div>
                        <div class="form-group col-sm-12">
                        	<div class="col-sm-6 mall-floor">
                        		<label for="tag_group_id_add">楼层</label>
                        	</div>
                        	<div class="col-sm-6 brand-category">
                        		<label for="tag_group_id_add">品牌分类</label>
                        	</div>
                        </div>
                        <div class="form-group col-sm-12">
                        	<div class="col-sm-6">
                            	<label for="tag_group_id_add"><span class="text-danger" style="font-size:20px;">* </span>品牌图片</label>
                                <button type="button" class="btn btn-success depart-modal upload-img-btn" data-type="1" style="width: 100px;">上传图片</button>
                                <br/><br/>
                                <img alt="" src="" style="margin-left:75px;" class="brand_img">
                                <input value="" id="brand_img" name="brand_img" class="form-control" type="hidden">
                        	</div>
                            <div class="col-sm-6">
                            	<label for="tag_group_id_add"><span class="text-danger" style="font-size:20px;">* </span>手机品牌图片</label>
                                <button type="button" class="btn btn-success depart-modal upload-img-btn-wap" data-type="1" style="width: 100px;">上传图片</button>
                                <br/><br/>
                                <img alt="" src="" style="margin-left:75px;" class="brand_img_wap">
                                <input value="" id="brand_img_wap" name="brand_img_wap" class="form-control" type="hidden">
                            </div>
                        </div>
                        <p style="font-size:16px;margin-left:30px;">备注：上传JPG格式的图片，图片大小在30kb以内。</p>
                        <!-- mod by lizenan 20180212 【后台需求】商城导览/商城导览添加/修改界面去除品牌图片Alt和手机品牌图片Alt 515 start -->
                        <!-- <div class="form-group col-sm-12">
                        	<div class="col-sm-12">
                                <label for="tag_group_id_add">品牌图片Alt</label>
                                <input style="width: 50%;" class="form-control" name="brand_img_alt" id="brand_img_alt" placeholder="品牌图片Alt" type="text">
                        	</div>
                        </div>
                        <div class="form-group col-sm-12">
                        	<div class="col-sm-12">
                                <label for="tag_group_id_add">手机品牌图片Alt</label>
                                <input style="width: 50%;" class="form-control" name="brand_img_wap_alt" id="brand_img_wap_alt" placeholder="手机品牌图片Alt" type="text">
                        	</div>
                        </div> -->
                        <!-- mod by lizenan 20180212 【后台需求】商城导览/商城导览添加/修改界面去除品牌图片Alt和手机品牌图片Alt 515 end -->
                        <div class="form-group col-sm-12">
                        	<div class="col-sm-6">
                        		<label for="tag_group_id_add">国家</label>
                            	<input style="width: 50%;" class="form-control" name="country_name" id="country_name" placeholder="国家" type="text">
                        	</div>
                            <div class="col-sm-6">
                            	<br/>
                                <button type="button" class="btn btn-success depart-modal upload-img-btn-country" data-type="1" style="width: 100px;">上传国旗</button>
                                <img alt="" src="" style="margin-left:10px;" class="country_img">
                                <input value="" id="country_img" name="country_img" class="form-control" type="hidden">
                            </div>
                        </div>
                        <div class="form-group col-sm-12">
                        	<div class="col-sm-12">
                                <label for="tag_group_id_add"><span class="text-danger" style="font-size:20px;">* </span>状态</label>
                                <select name="use_flg" id="use_flg" style="width: 50%;"  class="form-control">
                                	<option value="1">启用</option>
                                	<option value="0">禁用</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group col-sm-12">
                        	<div class="col-sm-12">
                                <label for="tag_group_id_add">链接</label>
                                <input style="width: 50%;" class="form-control" name="url" id="url" placeholder="链接" type="text">
                            </div>
                        </div>
                        <div class="form-group col-sm-12">
                        	<div class="col-sm-12">
                                <label for="tag_group_id_add">备注</label>
                                <textarea style="width: 50%;"  class="form-control" name="remark" placeholder="备注" id="remark"></textarea>
                            </div>
                        </div>
                        <input name="brand_id" type="hidden" id="brand_id">
                    </div>
                </form>
                <div style="display: none">
                    <?php $form = ActiveForm::begin(['id'=>'upload_form_update','action'=>'/common/img-upload'],['options' => ['enctype' => 'multipart/form-data']]) ?>
                    <?= $form->field($model, 'img_url')->fileInput(['class' => 'upload_file_ot']) ?>
                    <?php ActiveForm::end() ?>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <a type="button" class="btn btn-primary ajax_post_tag">提交</a>
            </div>
        </div>
    </div>
</div>
<input name="class_len" id="class_len" value="0" type="hidden"/>
<input id="img_class" value="upload-img-btn" type="hidden"/>
<!-- 固定js -->
<script type="text/javascript" src="/static/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script type="text/javascript" src="/static/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/plugins/datatables/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/static/plugins/datatables/dataTables.bootstrap.min.js"></script>
<script type="text/javascript" src="/static/jBox/jquery.jBox-2.3.min.js"></script>
<script type="text/javascript" src="/static/jBox/i18n/jquery.jBox-zh-CN.js"></script>
<script type="text/javascript" src="/static/plugins/treeTable/jquery.treetable.js"></script>
<!-- 图片上传插件 -->
<script type="text/javascript" src="../static/plugins/jquery.form.js"></script>
<!-- 图片显示插件 -->
<script type="text/javascript" src="../static/plugins/layer/layer.js"></script>
<!-- 搜索下拉框 -->
<script type="text/javascript" src="../static/app/goods-keyword/js/jquery.dropdown.js"></script>
<script type="text/javascript" src="../static/app/goods-keyword/js/mock.js"></script>
<!-- 自定义js -->
<script type="text/javascript" src="/static/app/global.js?version=<?=Yii::$app->params['version']?>"></script>
<script type="text/javascript" src="/static/app/shopping-mall/index.js?version=<?=Yii::$app->params['version']?>"></script>
<script>
var mall_floor = <?=(is_array($mall_floor) ? json_encode($mall_floor) : '')?>;
var brand_category = <?=(is_array($brand_category) ? json_encode($brand_category) : '')?>;
var imageBathUrl = '<?=Yii::$app->params['imageBathUrl'] . '/' ?>';
</script>